package day06;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class P08FileCopy2 {
    public static void main(String[] args) {
        try {
            BufferedInputStream bis = new BufferedInputStream(new FileInputStream("A.txt"));
            BufferedOutputStream bos = new BufferedOutputStream((new FileOutputStream("B.txt", true)));//追加模式

            int x;
            while ((x = bis.read()) != -1) {
                bos.write(x);
            }


            bis.close();
            bos.close();

        } catch (IOException e) {

        }

    }
}
